<?php
/*use Zend\Form\Element;
$this->headScript()->appendFile('http://code.jquery.com/jquery-1.8.3.js','text/javascript');
$this->headScript()->appendFile('http://code.jquery.com/ui/1.10.0/jquery-ui.js','text/javascript');
// Attach jQuery UI Styles
$this->headLink()->appendStylesheet('http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css');
// UI Initializer for buttons
$this->headScript()->appendScript(
'$(document).ready(function(){
  function delete(url)
  {
          if(confirm("test")){ 
          $.ajax({url:url,success:function(data){alert("Deleted Record")}});
          }    
  });','text/javascript');

*/
$title = 'My uploads';
$this->headTitle($title);
//$this->setAttribute('method', 'post');
?>

<script>
function myFunction() {   
    if (confirm("Are You Sure?") == true) {     
    } else {  
    }
}
</script>

 <!-- <a class="btn" href="#" id = "delete_link2"  onclick="myFunction()" > Delete</a> -->
 
 <div class="well well-small">
    <h3><?php echo $this->escapeHtml($title);?></h3>
 </div>
 

<table class="table">
 <tr>
     <th>Label</th>
     <th>FileName</th>
     <th>Action</th>
     
 </tr>
 <?php foreach ($this->myUploads as $myUpload) : ?>
 <tr>
     <td><?php echo $this->escapeHtml($myUpload->label);?></td>
     <td><?php echo $this->escapeHtml($myUpload->filename);?></td>
    
     <td>   
         <a href="<?php echo $this->url('upploadmanager', array('action'=>'edit', 'id' => $myUpload->id));?>">Edit |</a>    
         <a href="<?php echo $this->url('upploadmanager', array('action'=>'delete', 'id' => $myUpload->id));?>"
             onclick="myFunction()" > Delete</a>
     </td>
 </tr>
 <?php endforeach; ?>
 </table>
 
 
 
 
<?php 
$title_shared = 'Shared uploads';
//$this->headTitle($title);
?>
 
 <h3><?php echo $this->escapeHtml($title_shared);?></h3>
 

<table class="table">
 <tr>
     <th>Label</th>
     <th>FileName(download)</th>
     <th>Shared By</th>
     
 </tr>
 <?php foreach ($this->sharedUploads as $sharedUpload) : ?>
 <tr>
     <td><?php echo $this->escapeHtml($sharedUpload->label);?></td>
     <td><a href="<?php echo $this->url('upploadmanager', array('action'=>'fileDownload','id' => $sharedUpload->id));?>"><?php echo $this->escapeHtml($sharedUpload->filename);?></a></td>
    
     <td><?php echo $this->escapeHtml($sharedUpload->name);?></td>          
  
 </tr>
 <?php endforeach; ?>
</table>
 <p>
     <a class="btn" href="<?php echo $this->url('upploadmanager', array('action'=>'add'));?>">Add a new upload</a>
 </p>
 
 
